<script src="/include/calendar/calendar.js"></script>
<style type="text/css">
#search-form input,#search-form select {
	width: 128px;
}
</style>
<div class="pageheader">
	<h2>
		<i class="fa fa-pencil-square"></i>日志管理
	</h2>
	<div class="breadcrumb-wrapper">
		<span class="label">你所在的位置：</span>
		<ol class="breadcrumb">
			<li><a href="/index">ERP管理系统</a></li>
			<li>日志管理</li>
			<li class="active">操作日志</li>
		</ol>
	</div>
</div>
<div class="contentpanel">
<div class="main">
    <form id="search-form" class="form-inline" method="post" action="/log/operlog" style="margin-bottom: 10px;">
        <div class="form-group">
            <!-- <label for="Orderid">订单号</label> -->
            <input type="text" name="orderid" value="<?php echo $this->orderid;?>" class="form-control" placeholder="订单号">
        </div>
        <div class="form-group">
            <!-- <label for="Sku">SKU</label> -->
            <input type="text" name="sku" value="<?php echo $this->sku;?>" class="form-control" placeholder="SKU">
        </div>
        <div class="form-group">
            <!-- <label for="Site">网站</label> -->
            <select class='form-control' name='site'>
                <option value='' <?php if($this->site == ''){echo 'selected="selected"';}?>>选择网站</option>
                <option value='gogoalshop.com' <?php if($this->site == 'gogoalshop.com'){echo 'selected="selected"';}?>>gogoalshop.com</option>
		        <option value='minejerseys.com' <?php if($this->site == 'minejerseys.com'){echo 'selected="selected"';}?>>minejerseys.com</option>
		        <option value='jerseysmark.com' <?php if($this->site == 'jerseysmark.com'){echo 'selected="selected"';}?>>jerseysmark.com</option>
		        <option value='goaljerseys.com' <?php if($this->site == 'goaljerseys.com'){echo 'selected="selected"';}?>>goaljerseys.com</option>
		        <option value='fancybestdeal.com' <?php if($this->site == 'fancybestdeal.com'){echo 'selected="selected"';}?>>fancybestdeal.com</option>
	    	    <option value='elmontyouthsoccer.com' <?php if($this->site == 'elmontyouthsoccer.com'){echo 'selected="selected"';}?>>elmontyouthsoccer.com</option>
		        <option value='bestcheapsoccer.com' <?php if($this->site == 'bestcheapsoccer.com'){echo 'selected="selected"';}?>>bestcheapsoccer.com</option>
	    	</select>
        </div>
        <div class="form-group">
            <label for="date">日期:</label>
            <input class="form-control" type="text" name="starttime" onclick="new Calendar().show(this);" readonly="readonly" value="<?php echo $this->starttime;?>">
	               至<input class="form-control" type="text" name="endtime" onclick="new Calendar().show(this);" readonly="readonly" value="<?php echo $this->endtime;?>">
        </div>
        <button type="submit" class="btn btn-primary">搜索</button>
    </form>
    <div class="table-responsive">
        <table class="table table-bordered table-hover">
            <thead>
                <tr>
                    <th>订单号</th>
                    <th>网站</th>
                    <th>SKU</th>
                    <th>产品名称</th>
                    <th>尺码</th>
                    <th>分拣时间</th>
                    <th>分拣员</th>
                    <th>操作时间</th>
                    <th>操作员</th>
                    <th>赠品</th>
                </tr>
            </thead>
            <tbody>      
                <?php 
                if ($this->logList){
                	$i=0;
                	$class = 'info';
                    foreach ($this->logList as $v){
                    	if($i>0){
                    		if($v['order_id'] == $this->logList[$i-1]['order_id']){
                    			//$class='info';
                    		}else{
                    			$class = $class=='warning'?'info':'warning';
                    		}
                    	}
                    	$i+=1;
                ?>
                <tr class="<?php echo $class;?>">
				    <td><a target="_blank" href="<?php echo $this->url(array('controller'=>'log','action'=>'index','oid' =>$v['order_id'],'site'=>$v['site']),null,true);?>"><?php echo $v['order_id']; ?></a></td>
                    <td><?php echo $v['site'];?></td>
                    <td><?php echo $v['sku'];?></td>
                    <td><?php echo $v['title'];?></td>
                    <td><?php echo $v['size'];?></td>
				    <td><?php echo $v['add_time']; ?></td>
				    <td><?php echo $v['adduser']; ?></td>
				    <td><?php echo $v['oper_time']; ?></td>
				    <td><?php echo $v['operuser']; ?></td>
				    <td><?php if($v['isgift']){echo '否';}else{echo '是';}; ?></td>
			    </tr> 
			    <?php 
                    } 
                }
                ?>
			    <tr>
			        <td colspan="8">
			        <?php
					     echo $this->paginationControl ( $this->paginator, 'Sliding', 'page/pager.phtml', array (
					     	'orderid'=>$this->orderid,
					     	'site'=>$this->site,
					     	'sku'=>$this->sku,
						    'starttime' => $this->starttime,
						    'endtime' => $this->endtime 
				    	) );
				    ?>
			        </td>
			    </tr>
		    </tbody>
        </table>
    </div>
</div>
</div>
